package gorreteapps.amigoinvisible.utils;

import gorreteapps.amigoinvisible.R;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class AlertDialogFactory {

	/**
	 * Create a warning alert dialog with a OK button
	 * 
	 * @param context
	 * @return AlertDialog
	 */
	public static AlertDialog warningAlertDialog(Context context, String errorMsg){
		AlertDialog alert = new AlertDialog.Builder(context, AlertDialog.BUTTON_NEGATIVE).create();
		alert.setTitle("Advertencia");
		alert.setMessage(errorMsg);
		alert.setIcon(R.drawable.warning);
		
		alert.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				return;					
			}
		});
		
		return alert;
	}
	
}
